package com.wrh.draw.util;


import java.awt.*;
import java.util.List;

/**
 * @author  wrh
 */
public class Graphics2DUtil {

    public static void drawPolygon(Graphics2D g, List<Point> pointList) {
        int size = pointList.size();
        int[] xs = new int[size];
        int[] ys = new int[size];
        for (int i = 0; i < size; i++) {
            Point point = pointList.get(i);
            xs[i] = point.x;
            ys[i] = point.y;
        }
        g.drawPolygon(xs, ys, size);
    }

}
